<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <title>Document</title>
</head>

<body>
    <div id="app">
        <h1>登录/注册</h1>
        <button @click="isLogin=true">登录</button> <button @click="isLogin=false">注册</button>
        <div v-if="isLogin" key="loging">
            <h2>登录</h2>
            <p><input type="text" placeholder="请输入用户名"></p>
            <p><input type="text" placeholder="请输入用户名密码"></p>
        </div>
        <div v-else key="zhuce">
            <h2 >注册</h2>
            <p><input type="text" placeholder="请注册用户名"></p>
            <p><input type="text" placeholder="请注册用户名密码"></p>
        </div>
    </div>
    <script>
        const vm = new Vue({
            data() {
                return {
                    isLogin: true
                }
            },
            methods: {

            }
        }).$mount("#app")
    </script>
</body>

</html>